<?php

namespace app\common\model;

use think\Model;

class BaseModel extends Model
{

    public function page($page, $limit, $where = null, $order = null)
    {
        $result['data'] = $this
            ->where($where)
            ->order($order)
            ->limit($page, $limit)
            ->select();

        $result['count'] = $this
            ->where($where)
            ->count();

        return $result;
    }
}
